import { PureComponent } from "react"

function UserInfoHoc(OriginComponent) {
  class UserInfoHOC extends PureComponent {
    constructor() {
      super()
      this.state = {
        userInfo: {
          name: "name",
          pwd: "password"
        }
      }
    }

    render() {
      return (
        <div>
          <OriginComponent {...this.props} {...this.state.userInfo} />
        </div>
      )
    }
  }

  return UserInfoHOC
}

export default UserInfoHoc
